package com.nft.service.school.config;

import feign.Request;
import feign.Retryer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FeignCustomConfig {

    /**
     * 设置feign的超时时间
     * 
     * @return
     */
    @Bean
    Request.Options feignOptions() {
        return new Request.Options(/**connectTimeoutMillis**/
            20 * 1000, /** readTimeoutMillis **/
            20 * 1000);
    }

    /**
     * 设置feign的永不重试
     * 
     * @return
     */
    @Bean
    Retryer feignRetryer() {
        return Retryer.NEVER_RETRY;
    }
}
